package com.atwisdom.star.controller;

import com.atwisdom.star.common.vo.ResultInfo;
import com.atwisdom.star.core.bsl.allModel.Impl.ModelBslServiceImpl;
import com.atwisdom.star.core.bsl.allModel.Impl.ModelInfoBslServiceImpl;
import com.atwisdom.star.exception.pojo.BusinessException;
import com.atwisdom.star.log.aop.StarAnnotation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/bsl")
public class BslController {
    private ModelBslServiceImpl modelBslService;
    private ModelInfoBslServiceImpl modelInfoBslService;


    @Autowired
    public void setModelBslService(ModelBslServiceImpl modelBslService) {
        this.modelBslService = modelBslService;
    }
    @Autowired
    public void setModelInfoBslService(ModelInfoBslServiceImpl modelInfoBslService) {
        this.modelInfoBslService = modelInfoBslService;
    }
    /**
     * 获取系统所有模型
     *
     * @return 返回结果
     * @throws BusinessException 异常
     */
    @StarAnnotation
    @PostMapping(value = "/getAllModel")
    public ResultInfo<?> getAllModel() throws BusinessException {
        return modelBslService.getAllModel();
    }

    /**
     * 获取系统所有模型摘要信息
     *
     * @return 返回结果
     * @throws BusinessException 异常
     */
    @StarAnnotation
    @PostMapping(value = "/getAllModelInfo")
    public ResultInfo<?> getAllModelInfo() throws BusinessException {
        return modelInfoBslService.getAllModelInfo();
    }
}
